<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">姓名:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">身份证号:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-idcard" class="form-control" data-rule="required" name="row[idcard]" type="text" value="{$row.idcard|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">联系电话:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-mobile" class="form-control" data-rule="required" name="row[mobile]" type="text" value="{$row.mobile|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">头像:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-avator" class="form-control" size="50" name="row[avator]" type="text" value="{$row.avator|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-avator" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-avatar"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-avator" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-avator"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-avator"></ul>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">性别:</label>
        <div class="col-xs-12 col-sm-8">
            {foreach name="genders" item="vo"}
                <div class="radio">
                    <label>
                        <input name="row[gender]" type="radio" value="{$key}" {in name="key" value="$row.gender"}checked{/in}> {$vo}
                    </label>
                </div>
            {/foreach}
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">血型:</label>
        <div class="col-xs-12 col-sm-8">
            {foreach name="blood_types" item="vo"}
                <div class="radio">
                    <label>
                        <input name="row[blood_types]" type="radio" value="{$vo}" {in name="vo" value="$row.blood_types"}checked{/in}> {$vo}
                    </label>
                </div>
            {/foreach}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">年龄:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-age" data-rule="required" class="form-control" name="row[age]" type="text" value="{$row.age|htmlentities}">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">出生日期:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-birth" data-rule="required" class="form-control" name="row[birth]" type="text" value="{$row.birth|htmlentities}">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">身高:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-height"  class="form-control" name="row[height]" type="text" value="{$row.height|htmlentities}">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">体重:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weight"  class="form-control" name="row[weight]" type="text" value="{$row.weight|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">紧急联系人:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-jinji_name" class="form-control" name="row[jinji_name]" type="text" value="{$row.jinji_name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">紧急联系电话:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-jinji_mobile" data-rule="required" class="form-control" name="row[jinji_mobile]" type="text" value="{$row.jinji_mobile|htmlentities}">
        </div>
    </div>
	<div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">详细地址:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-address" class="form-control" name="row[address]" type="text" value="{$row.address|htmlentities}">
        </div>
    </div>


    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">健康状况:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-content" class="form-control " rows="5" name="row[content]" cols="50"> {$row.content|htmlentities}</textarea>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">门诊病例:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <!-- 存储多张图片URL（逗号分隔），隐藏默认输入框（可选，仅用于存储） -->
                <input id="c-outpatient" class="form-control" size="50" name="row[outpatient]" type="text"  value="{$images.outpatient|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <!-- 上传按钮：data-multiple 改为 true，支持多文件上传 -->
                    <span><button type="button" id="faupload-outpatient" class="btn btn-danger faupload"
                                  data-input-id="c-outpatient"
                                  data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp"
                                  data-multiple="true"
                                  data-preview-id="p-outpatient"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <!-- 选择按钮：同样开启多文件选择 -->
                    <span><button type="button" id="fachoose-outpatient" class="btn btn-primary fachoose"
                                  data-input-id="c-outpatient"
                                  data-mimetype="image/*"
                                  data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-outpatient"></span>
            </div>
            <!-- 多图预览列表：FA 组件自动渲染多张图片，添加样式适配多行展示 -->
            <ul class="row list-inline faupload-preview" id="p-outpatient" style="margin-top: 10px;"></ul>
            <!-- 提示文字：告知用户支持多张上传及操作方式 -->
            <div class="help-block">
                <i class="fa fa-info-circle"></i> 支持上传多张图片（格式：jpg/png/gif等），点击预览图可删除对应图片
            </div>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">体检报告:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <!-- 存储多张图片URL（逗号分隔），隐藏默认输入框（可选，仅用于存储） -->
                <input id="c-physical" class="form-control" size="50" name="row[physical]" type="text"  value="{$images.physical|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <!-- 上传按钮：data-multiple 改为 true，支持多文件上传 -->
                    <span><button type="button" id="faupload-physical" class="btn btn-danger faupload"
                                  data-input-id="c-physical"
                                  data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp"
                                  data-multiple="true"
                                  data-preview-id="p-physical"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <!-- 选择按钮：同样开启多文件选择 -->
                    <span><button type="button" id="fachoose-physical" class="btn btn-primary fachoose"
                                  data-input-id="c-physical"
                                  data-mimetype="image/*"
                                  data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-physical"></span>
            </div>
            <!-- 多图预览列表：FA 组件自动渲染多张图片，添加样式适配多行展示 -->
            <ul class="row list-inline faupload-preview" id="p-physical" style="margin-top: 10px;"></ul>
            <!-- 提示文字：告知用户支持多张上传及操作方式 -->
            <div class="help-block">
                <i class="fa fa-info-circle"></i> 支持上传多张图片（格式：jpg/png/gif等），点击预览图可删除对应图片
            </div>
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
